<?php
/** 
 * $Source: /cvsroot/pn-commerce/pn-commerce/pntemplates/plugins/function.pncCountrySelectlist.php,v $
 * $Author: landseer $
 * $Revision: 1.3 $
 * $Date: 2004/02/17 16:15:55 $
 *
 * Type: Function
 *
 * creates a list of <option></option> with all country names 
 *@param params['SelectedCountry']  string country name for preselection (might be empty)
 *@return string complete <option></option> statement list
 */
function smarty_function_pncCountrySelectlist($params, &$smarty)
{
    extract( $params );
    $countrylist = ""._PNC_COUNTRIES;
    $countrylist = split(",", $countrylist);
    array_push( $countrylist, pnVarPrepForDisplay(_PNC_USA) );
    array_push( $countrylist, pnVarPrepForDisplay(_PNC_CANADA) );
    asort( $countrylist );

    $select[$SelectedCountry] = 'selected';  
	foreach( $countrylist as $country )
    {
        $temp .= "<option value='$country' ".$select[$country].">$country</option>\n"; ;
    }
    return $temp;
}

?>
